//
//  SummerTableViewCell.m
//  ProjectA
//
//  Created by dlios on 15-3-6.
//  Copyright (c) 2015年 dlios. All rights reserved.
//

#import "SummerTableViewCell.h"

@implementation SummerTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self show];
    }
    return self;
}

- (void)show
{
    
    //占位食物图片
    UIImage *placeholderImage = [UIImage imageNamed:@"placeholder_Phone@2x.png"];
    self.imageV = [[UIImageView alloc] initWithImage:placeholderImage];
    self.imageV.frame = CGRectMake(0, 3, 88, 72);
    [self.contentView addSubview:self.imageV];
    //菜名
    self.nameLable = [[UILabel alloc] init];
    self.nameLable.frame = CGRectMake(self.imageV.frame.origin.x + self.imageV.frame.size.width + 20, 16, 200, 25);
    //self.nameLable.backgroundColor = [UIColor lightGrayColor];
    //self.nameLable.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.nameLable];
    //食材
    self.foodLable = [[UILabel alloc] init];
    self.foodLable.frame = CGRectMake(self.nameLable.frame.origin.x + 20,  self.nameLable.frame.origin.y + self.nameLable.frame.size.height + 8, 200, 15);
    //self.foodLable.backgroundColor = [UIColor lightGrayColor];
    self.foodLable.textColor = [UIColor grayColor];
    self.foodLable.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:self.foodLable];
    
    UIImage *image = [UIImage imageNamed:@"mtrls_icon.png"];
    UIImageView *imageV = [[UIImageView alloc] initWithImage:image];
    imageV.frame = CGRectMake(self.foodLable.frame.origin.x -22, self.foodLable.frame.origin.y, 16, 16);
    [self addSubview:imageV];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
